define(['text!service/chagesList.html'],
	function(viewTemplate) {
		return Piece.View.extend({
			id: 'service_chagesList',
			events:{
				"click .charge li" : "detail"
			},
			render: function() {
				$(this.el).html(viewTemplate);
				Piece.View.prototype.render.call(this);
				return this;
			},
			onShow: function() {
				/*var windowHeight = $(window).height();
				var elTop = $("#chagesList").offset().top;
				var elHeight = windowHeight - elTop ;

				console.info(elHeight);
				$("#chagesList").css({
					"height": elHeight
				});*/
				
				
				new iScroll($("#chagesList")[0]);

			},
			detail: function(){
				this.container.navigateForResult('/service/chagesdetail',{
					trigger:true
				},'service/chagesList', this.onGotResult);
			}
		}); //view define

	});